/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package filenetapis.pe;

import filenet.vw.api.VWException;
import filenet.vw.api.VWSession;
import filenet.vw.api.VWStepElement;

/**
 *
 * @author Administrator
 */
public class launchWF extends PEHandler {

    public String[] launch_WF() {
        String[] workClassNames = null;
        try {
            this.openPEConn();
            String workflowName = "CreatedWorkflow";

            workClassNames = this.getMyPESession().fetchWorkClassNames(true);
            System.out.println("------------------------------2");

            VWStepElement stepElement = this.getMyPESession().createWorkflow(workflowName);
            stepElement.setParameterValue("Age", 19, true);
            stepElement.setParameterValue("ID", 838383, true);
            stepElement.setParameterValue("Name", "Mohammad Awwad", true);

            stepElement.doDispatch();
            System.out.println("------------------------------3");

            this.closePEConn();

        } catch (Exception vwe) {
            logger.error(vwe);
        } finally {

            return workClassNames;
        }
    }
}
